<template>
  <div class="">
    <Title title="推荐有奖"></Title>
    <div class="job-ad">
      <image src="../../static/contact-ad.png" />
    </div>

    <CompanyInfo :info="info"> </CompanyInfo>
    <Contact> </Contact>
  </div>
</template>
<script>
  const wxapp = getApp()
  import Title from '@/components/Title'
  import CompanyInfo from '@/components/CompanyInfo'
  import Contact from '@/components/contact'
  export default {
    data() {
      return {
        info: {}
      }
    },
    components:{
      Title,
      CompanyInfo,
      Contact
    },
    onShow() {
      let that = this
        console.log(1);
        var info = wx.getStorageSync('base')
        if (info) {
            // Do something with return value
            that.info = info
            console.log(2);
        }else {
          wx.request({
            url: 'https://hzy.api.szjisou.com/', //仅为示例，并非真实的接口地址
            data: {
               service: 'App.Hong.GetBase',
               table: '4_block'
            },
            success: function(res) {
              let data = res.data.data.result
              that.info = data
              wx.setStorageSync('base', data)
            }
          })
        }

    }
  }
</script>
<style scoped>
  .job-ad{
    height: 274rpx;

  }
  .job-ad image{
    width: 100%;
    height: 274rpx;
  }
</style>
